Skip to content

[3.x] Allow a custom separator in MatchPattern and MatchPatterns - #376

Open
slachiewicz wants to merge 1 commit into
plexus-utils-3.xfrom
agent/match-patterns-separator-3.x
Open

slachiewicz wants to merge 1 commit into
plexus-utils-3.xfrom
agent/match-patterns-separator-3.x

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Adds MatchPattern.fromString(String, String) and MatchPatterns.withSeparator(...), so patterns and the names matched against them can use a separator other than File.separator, plus MatchPatterns.getPatterns() and toString() on both classes. This lets downstream code that keeps a modified copy of these classes use plexus-utils instead.

The factory has its own name because a from(String separator, String...) overload would be ambiguous with from(String...). matches(String, boolean) and matchPatternStart now use the pattern's separator, which is still File.separator for the existing factories.

Same change as #375.

matches(String, boolean) and matchPatternStart now split with the
pattern's own separator; for from(...) and fromString(String) that is
still File.separator, so existing callers see no change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant